package com.colin.widget;

import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebView;

import com.colin.capture.colin_utils.R;


/**
 * Created by colin on 2018/2/7 8:00 .
 */

public class WebFragment extends DialogFragment {
	private View mView;
	private WebView mWebView;
	private String url;
	public void setUrl(String url){
		this.url = url;
	}
	@NonNull
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		AlertDialog dialog = new AlertDialog.Builder(getActivity()).create();
		mView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_web,null);
		mWebView = mView.findViewById(R.id.web);
		mWebView.loadUrl(url);
		dialog.setContentView(mView);
		return dialog;
	}
}
